<script setup>
import request from "../utils/axios.js";
import {reactive, onMounted} from 'vue'
let jsonData =reactive({code:1,content:'我努力不是为了你而是因为你'})
let getLoveMessage = async ()=>{
  let {data} = await request.get("api/rand.qinghua?format=json/");
  Object.assign(jsonData, data);
}

onMounted(()=>{
  getLoveMessage()
})
</script>

<template>
  <div>
    <h3>今日土味情话:{{jsonData.content}}</h3>
    <button  @click="getLoveMessage">获取今日土味情话</button>
  </div>
</template>

<style scoped>

</style>
